package Package.IOStream.CharacterStream.DataRead;

import java.io.*;

public class DataRead {
    public static void DataRead() throws IOException {
        OutputStreamWriter OSW=new OutputStreamWriter(new FileOutputStream("D:\\insert\\a.txt"));
        InputStreamReader ISW=new InputStreamReader(new FileInputStream("D:\\insert\\javase\\b.txt"));
        OSW.write("ChngaCun");
//        方法名 说明
//int read() 一次读一个字符数据
//        int read = ISW.read();
//        System.out.println(read);
//int read(char[] cbuf) 一次读一个字符数组数据

        char[] chas=new char[1024];
        int len;
        while ((len=ISW.read(chas))!=-1){
                System.out.print(new String(chas,0,len));

        }
        ISW.close();
        OSW.close();
    }
}
